package br.org.blacklist.service.governamental;

import java.util.List;

import javax.jdo.JDOException;
import javax.jdo.PersistenceManager;
import javax.jdo.Query;

import com.google.inject.Inject;
import com.google.inject.Provider;

import br.org.blacklist.core.jdo.BlacklistQuery;
import br.org.blacklist.model.governamental.Instituicao;


public class InstituicaoQuery extends BlacklistQuery<Instituicao> implements InstituicaoQueryInterface {

    @Inject
    public InstituicaoQuery(Provider<PersistenceManager> provider) {
        super(Instituicao.class, provider);
    }

    @Override
    public List<Instituicao> findAll() throws JDOException {
        Query query = newQuery();
        query.setOrdering("poder desc");
        return toList(query.execute());
    }
    
}
